Personal tools

Lua/Tutorials/Iterators

From JC2-MP Documentation

< Lua‎ | Tutorials
Jump to: navigation, search

Some of the functions in the API use iterator functions. These must be used with for statements.

As an example, if you want to use Server:GetPlayers, use the following syntax:

for player in Server:GetPlayers() do
	print(player)
end

See also